package cn.edu.xmu.oomall.liquidation.microservice;

import cn.edu.xmu.oomall.liquidation.microservice.vo.LiquidationShareRetVo;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "share-service")
public interface ShareService {
    @PutMapping("/internal/beshared/{id}")
    InternalReturnObject updateBeSharedState(@PathVariable("id") Long id, @RequestParam Byte state);

    @GetMapping("/internal/beshared")
    InternalReturnObject<List<LiquidationShareRetVo>> getBesharedList(@RequestParam Long productId, @RequestParam Long onsaleId, @RequestParam Long customerId);

    @PutMapping("/internal/shares/{id}")
    InternalReturnObject addSharesQuantity(@PathVariable("id") Long id, @RequestParam Long quantity);

    @GetMapping("/internal/shares/{id}")
    InternalReturnObject<Long> getSharesQuantity(@PathVariable("id") Long id);
}
